home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Utils / GParted Live CD / Bin / gparted-livecd-0.2.2.iso / bin / xres < prev    next >
Encoding:
Text File  |  2006-02-14  |  3.4 KB  |  177 lines

  1. #!/bin/sh
  2. ############################################################################
  3. #    Copyright (C) 2006 by Patrick J. Verner                               #
  4. #    exodusrobot@yahoo.com                                                 #
  5. #                                                                          #
  6. #    This program is free software; you can redistribute it and/or modify  #
  7. #    it under the terms of the GNU General Public License as published by  #
  8. #    the Free Software Foundation; either version 2 of the License, or     #
  9. #    (at your option) any later version.                                   #
  10. ############################################################################
  11.  
  12. #make sure temp exists
  13. temp=/tmp/xres
  14. temp1=/tmp/xres
  15. if [ ! -d $temp1 ]
  16.   then
  17.     mkdir -p $temp1
  18.     chmod 700 $temp1
  19. fi
  20.  
  21. #remove X config
  22. if [ -f /root/X ]
  23.   then
  24.     rm /root/X
  25. fi
  26.  
  27. #**********main menu**********
  28. item="1024x768"
  29. while [ 0 ]
  30.   do
  31. dialog --title "GParted LiveCD XRES" --default-item "$item" --backtitle "GParted Livecd" --menu "Select your screen resolution:" 13 40 7 \
  32. "640x480" "" \
  33. "800x600" "" \
  34. "1024x768" "" \
  35. "1280x800" "" \
  36. "1280x1024" "" \
  37. "1400x1050" "" \
  38. "1600x1200" "" \
  39. 2> $temp1/return
  40. if [ ! $? = 0 ]
  41.   then
  42.     break
  43. fi
  44. REPLY=`cat $temp1/return`
  45. rm -f $temp1/return
  46.  
  47. #640x480
  48. if [ "$REPLY" = "640x480" ]
  49.   then
  50. cat > /root/X << "EOF"
  51. #!/bin/sh
  52. exec /usr/bin/X11/Xvesa -screen 640x480x\
  53. EOF
  54. chmod a+rwx /root/X
  55. cat >> /root/.fluxbox/apps << "EOF"
  56. [startup]  {gparted}
  57. [app] (gparted)
  58.   [Dimensions]    {635 452}
  59.   [Position]    (UPPERLEFT)    {0 0}
  60.   [Close]    {yes}
  61. [end]
  62. EOF
  63. break
  64. fi
  65.  
  66. #800x600
  67. if [ "$REPLY" = "800x600" ]
  68.   then
  69. cat > /root/X << "EOF"
  70. #!/bin/sh
  71. exec /usr/bin/X11/Xvesa -screen 800x600x\
  72. EOF
  73. chmod a+rwx /root/X
  74. cat >> /root/.fluxbox/apps << "EOF"
  75. [startup]  {gparted}
  76. [app] (gparted)
  77.   [Dimensions]    {795 574}
  78.   [Position]    (UPPERLEFT)    {0 0}
  79.   [Close]    {yes}
  80. [end]
  81. EOF
  82. break
  83. fi
  84.  
  85. #1024x768
  86. if [ "$REPLY" = "1024x768" ]
  87.   then
  88. cat > /root/X << "EOF"
  89. #!/bin/sh
  90. exec /usr/bin/X11/Xvesa -screen 1024x768x\
  91. EOF
  92. chmod a+rwx /root/X
  93. cat >> /root/.fluxbox/apps << "EOF"
  94. [startup]  {gparted}
  95. [app] (gparted)
  96.   [Dimensions]    {1019 740}
  97.   [Position]    (UPPERLEFT)    {0 0}
  98.   [Close]    {yes}
  99. [end]
  100. EOF
  101. break
  102. fi
  103.  
  104. #1280x800
  105. if [ "$REPLY" = "1280x800" ]
  106.   then
  107. cat > /root/X << "EOF"
  108. #!/bin/sh
  109. exec /usr/bin/X11/Xvesa -screen 1280x800x\
  110. EOF
  111. chmod a+rwx /root/X
  112. cat >> /root/.fluxbox/apps << "EOF"
  113. [startup]  {gparted}
  114. [app] (gparted)
  115.   [Dimensions]    {1275 740}
  116.   [Position]    (UPPERLEFT)    {0 0}
  117.   [Close]    {yes}
  118. [end]
  119. EOF
  120. break
  121. fi
  122.  
  123. #1280x1024
  124. if [ "$REPLY" = "1280x1024" ]
  125.   then
  126. cat > /root/X << "EOF"
  127. #!/bin/sh
  128. exec /usr/bin/X11/Xvesa -screen 1280x1024x\
  129. EOF
  130. chmod a+rwx /root/X
  131. cat >> /root/.fluxbox/apps << "EOF"
  132. [startup]  {gparted}
  133. [app] (gparted)
  134.   [Dimensions]    {1275 996}
  135.   [Position]    (UPPERLEFT)    {0 0}
  136.   [Close]    {yes}
  137. [end]
  138. EOF
  139. break
  140. fi
  141.  
  142. #1400x1050
  143. if [ "$REPLY" = "1400x1050" ]
  144.   then
  145. cat > /root/X << "EOF"
  146. #!/bin/sh
  147. exec /usr/bin/X11/Xvesa -screen 1400x1050x\
  148. EOF
  149. chmod a+rwx /root/X
  150. cat >> /root/.fluxbox/apps << "EOF"
  151. [startup]  {gparted}
  152. [app] (gparted)
  153.   [Position]    (UPPERLEFT)    {0 0}
  154.   [Close]    {yes}
  155. [end]
  156. EOF
  157. break
  158. fi
  159.  
  160. #1600x1200
  161. if [ "$REPLY" = "1600x1200" ]
  162.   then
  163. cat > /root/X << "EOF"
  164. #!/bin/sh
  165. exec /usr/bin/X11/Xvesa -screen 1600x1200x\
  166. EOF
  167. chmod a+rwx /root/X
  168. cat >> /root/.fluxbox/apps << "EOF"
  169. [startup]  {gparted}
  170. [app] (gparted)
  171.   [Position]    (UPPERLEFT)    {0 0}
  172.   [Close]    {yes}
  173. [end]
  174. EOF
  175. break
  176. fi
  177. done